#include "common.h"


void debug(char *chaine){
    if(DEBUG){
        printf("[DEBUG] %s",chaine);
    }
}

int tcharequ(char* tab1,char * tab2,unsigned int nbelem) {
    int i =0;
    if( nbelem>0)
    {
        for(i=0;i<nbelem;i++) {
                if (tab1[i]!=tab2[i]) return 0;
     }
     return 1;
    }
    else { return 0; }
}

char * tcharcpy(char* destination,char * source,unsigned int nbelem){
    int i;
    if (nbelem>=0) {
        for(i=0;i<nbelem;i++) {
            destination[i] = source[i];
        }
    } 
    return destination;
}

char * tcharcat(char* destination,unsigned int nbelem1,char * source,unsigned int nbelem2){
    int i,j;
    for(i = nbelem1,j=0;i<nbelem1+nbelem2;i++,j++){
        destination[i] = source[j];
    }
    return destination;
}